package com.wenli.lt.controller;


import com.wenli.lt.entity.Reportlist;
import com.wenli.lt.service.IReportlistService;
import com.wenli.lt.util.CommonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lt
 * @since 2021-03-23
 */
@RestController
@Api(tags = "举报")
@RequestMapping("reportlist")
public class ReportlistController {
    @Autowired
    IReportlistService reportlistService;

    @PostMapping("saveReportlist")
    @ApiOperation("发布举报")
    public CommonResponse saveReportlist(@RequestBody Reportlist reportlist){
        if (reportlistService.saveReportlist(reportlist)){
            return new CommonResponse("发布成功");

        }else {
            return new CommonResponse(CommonResponse.ERROR_CODE,"数据出错,请联系管理员");
        }
    }

}
